Skip to content

Add heltec_rcc6 board#11041

Open
Quency-D wants to merge 5 commits into
meshtastic:developfrom
Quency-D:heltec-rcc6
Open

Add heltec_rcc6 board#11041
Quency-D wants to merge 5 commits into
meshtastic:developfrom
Quency-D:heltec-rcc6

Conversation

@Quency-D

@Quency-D Quency-D commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Add support for the Heltec RCC6 ESP32-C6 board.

This includes the new PlatformIO board/environment, ESP32-C6 variant and pin mapping, SX1262 LoRa support, battery monitoring, USB CDC, and NV3001B TFT display support.

Changes

  • Add the heltec_rcc6 ESP32-C6 variant and Arduino pin mapping.
  • Add battery ADC power control and voltage monitoring.
  • Add classic TFTDisplay support for the 128×220 NV3001B display.
  • Add NV3001B display ID probing using the RDDID and RDID registers.
  • Disable and power down the display when no valid NV3001B is detected.

Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • Heltec RCC6

@Quency-D
Quency-D marked this pull request as draft July 17, 2026 03:16
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Heltec RCC6 ESP32-C6 board support with build metadata, pin and feature definitions, hardware identification, NV3001B display handling, and runtime screen detection.

Changes

Heltec RCC6 support

Layer / File(s) Summary
Board target and hardware contracts
boards/heltec-rcc6.json, variants/esp32c6/heltec_rcc6/*, src/platform/esp32/architecture.h
Defines board metadata, PlatformIO settings, ESP32-C6 pin mappings, radio/display configuration, build flags, and hardware model mapping.
NV3001B display backend
src/graphics/TFTDisplay.cpp
Adds RCC6-specific Arduino_GFX/NV3001B initialization, bitmap rendering, rotation, display power control, and disabled generic brightness/touch paths.
NV3001B screen detection
src/mesh/NodeDB.cpp
Reads the NV3001B identifier through GPIO routines and disables screen configuration when the expected display ID is not detected.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlatformIO
  participant TFTDisplay
  participant Arduino_NV3001B
  participant NodeDB
  participant NV3001B
  PlatformIO->>TFTDisplay: Build with HELTEC_RCC6
  TFTDisplay->>Arduino_NV3001B: Initialize over software SPI
  TFTDisplay->>Arduino_NV3001B: Render and control display
  NodeDB->>NV3001B: Read display identifier
  NV3001B-->>NodeDB: Return identifier
  NodeDB->>NodeDB: Set screen availability
Loading

Possibly related PRs

Suggested labels: hardware-support

Suggested reviewers: jp-bennett, thebentern

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was added, so the required template sections and testing attestations are missing. Add a PR description using the repository template, including a summary, any linked issue, and the required testing attestations.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the heltec_rcc6 board.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/graphics/TFTDisplay.cpp (1)

1626-1635: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return failure when the NV3001B cannot initialize.

A failed begin() is only logged; execution continues through rotation, drawing, and ultimately returns true, falsely reporting a connected display.

Proposed fix
-    if (beginStatus)
-        LOG_DEBUG("TFT Success!");
-    else
+    if (!beginStatus) {
         LOG_ERROR("TFT Fail!");
+        return false;
+    }
+    LOG_DEBUG("TFT Success!");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/graphics/TFTDisplay.cpp` around lines 1626 - 1635, Update the TFT
initialization flow around beginStatus so a failed tft->begin() immediately
returns false from the enclosing display initialization function after logging
the failure. Preserve the existing success log and subsequent rotation/drawing
logic only for successful initialization, ensuring the function cannot report
true when the display fails to initialize.
🧹 Nitpick comments (1)
src/mesh/NodeDB.cpp (1)

254-254: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename get_nv3001b_id to getNv3001bId.

As per coding guidelines, “Use camelCase for functions and members.”

Proposed rename
-uint32_t get_nv3001b_id(uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst, uint8_t en, uint8_t bl)
+uint32_t getNv3001bId(uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst, uint8_t en, uint8_t bl)
...
-    uint32_t nv3001b_id = get_nv3001b_id(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);
+    uint32_t nv3001b_id = getNv3001bId(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);

Also applies to: 1140-1140

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mesh/NodeDB.cpp` at line 254, Rename the function get_nv3001b_id to
getNv3001bId and update every declaration, definition, and call site, including
the additional occurrence, while preserving its signature and behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/mesh/NodeDB.cpp`:
- Around line 1139-1144: Update the HELTEC_RCC6 display initialization flow so
the false value assigned to hasScreen after the NV3001B ID check prevents
TFTDisplay::connect() from starting when no panel is detected. Thread hasScreen
into the TFT startup path or gate the module connection, while preserving normal
initialization when the expected display is present.

---

Outside diff comments:
In `@src/graphics/TFTDisplay.cpp`:
- Around line 1626-1635: Update the TFT initialization flow around beginStatus
so a failed tft->begin() immediately returns false from the enclosing display
initialization function after logging the failure. Preserve the existing success
log and subsequent rotation/drawing logic only for successful initialization,
ensuring the function cannot report true when the display fails to initialize.

---

Nitpick comments:
In `@src/mesh/NodeDB.cpp`:
- Line 254: Rename the function get_nv3001b_id to getNv3001bId and update every
declaration, definition, and call site, including the additional occurrence,
while preserving its signature and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0debf068-32e4-4aca-8aab-623f5e419b07

📥 Commits

Reviewing files that changed from the base of the PR and between 8ebdae9 and c02f858.

📒 Files selected for processing (7)
  • boards/heltec-rcc6.json
  • src/graphics/TFTDisplay.cpp
  • src/mesh/NodeDB.cpp
  • src/platform/esp32/architecture.h
  • variants/esp32c6/heltec_rcc6/pins_arduino.h
  • variants/esp32c6/heltec_rcc6/platformio.ini
  • variants/esp32c6/heltec_rcc6/variant.h

Comment thread src/mesh/NodeDB.cpp
Comment on lines +1139 to +1144
#ifdef HELTEC_RCC6
uint32_t nv3001b_id = get_nv3001b_id(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);
if (nv3001b_id != NV3001B_EXPECTED_ID) {
hasScreen = false;
}
#endif // HELTEC_RCC6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Propagate the absent-display state into TFT startup. hasScreen only affects Bluetooth pairing mode here; RCC6 still builds with HAS_SCREEN, so TFTDisplay::connect() can still initialize a panel that was just detected as absent and powered off. Thread that state into display startup or gate the module connection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mesh/NodeDB.cpp` around lines 1139 - 1144, Update the HELTEC_RCC6 display
initialization flow so the false value assigned to hasScreen after the NV3001B
ID check prevents TFTDisplay::connect() from starting when no panel is detected.
Thread hasScreen into the TFT startup path or gate the module connection, while
preserving normal initialization when the expected display is present.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@Quency-D
Quency-D marked this pull request as ready for review July 18, 2026 09:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/graphics/TFTDisplay.cpp (2)

1654-1658: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove redundant rotation configuration.

The explicit branch for HELTEC_RCC6 sets the rotation to 3, which is exactly what the fallback #else branch does. This specific #elif can be removed to reduce code duplication without changing the behavior.

♻️ Proposed fix
-#elif defined(HELTEC_RCC6)
-    tft->setRotation(3);
 `#else`
     tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/graphics/TFTDisplay.cpp` around lines 1654 - 1658, Remove the redundant
HELTEC_RCC6 conditional branch in the display rotation configuration, leaving it
to use the existing fallback setRotation(3) behavior. Preserve the other
preprocessor branches and the fallback comment.

1616-1617: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider using hardware SPI instead of software SPI for better display performance.

Using Arduino_SWSPI for the display backend relies on software bit-banging, which can result in noticeably slow screen redraws and high CPU overhead. If the display pins on the ESP32-C6 can be mapped to a hardware SPI peripheral (e.g., using Arduino_ESP32SPI with an appropriate host like FSPI or SPI2_HOST), it is highly recommended to use it to improve UI responsiveness.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/graphics/TFTDisplay.cpp` around lines 1616 - 1617, Replace the
Arduino_SWSPI bus construction in the TFT initialization with an
Arduino_ESP32SPI hardware-SPI backend, using the appropriate ESP32-C6 host and
existing TFT pin assignments. Keep the Arduino_NV3001B initialization and
display configuration unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/graphics/TFTDisplay.cpp`:
- Around line 1654-1658: Remove the redundant HELTEC_RCC6 conditional branch in
the display rotation configuration, leaving it to use the existing fallback
setRotation(3) behavior. Preserve the other preprocessor branches and the
fallback comment.
- Around line 1616-1617: Replace the Arduino_SWSPI bus construction in the TFT
initialization with an Arduino_ESP32SPI hardware-SPI backend, using the
appropriate ESP32-C6 host and existing TFT pin assignments. Keep the
Arduino_NV3001B initialization and display configuration unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ead359f9-ef9a-4b4a-b5b8-6adc2ae99afe

📥 Commits

Reviewing files that changed from the base of the PR and between c02f858 and 7ec6fed.

📒 Files selected for processing (3)
  • src/graphics/TFTDisplay.cpp
  • src/mesh/NodeDB.cpp
  • variants/esp32c6/heltec_rcc6/platformio.ini
🚧 Files skipped from review as they are similar to previous changes (2)
  • variants/esp32c6/heltec_rcc6/platformio.ini
  • src/mesh/NodeDB.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant